package com.fimmlps.reronge.dto;

import com.fimmlps.reronge.entity.ActorSingle;
import com.fimmlps.reronge.entity.EntryTrigger;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ActorSingleDto {
    //不区分预览页和详情页，仅每次传送需要的数据即可
    private Integer actorSingleId;
    private Integer userId;
    private String userName;
    private String title;
    private String content;
    private Integer clicks;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private List<String> imgUrls;
    private List<EntryCommentDto> comments;

    public ActorSingleDto(ActorSingle actorSingle){
        actorSingleId = actorSingle.getActorSingleId();
        userId = actorSingle.getUserId();
        //username
        title = actorSingle.getTitle();
        content = actorSingle.getContent();
        clicks = actorSingle.getClicks();
        createTime = actorSingle.getCreateTime();
        updateTime = actorSingle.getUpdateTime();
        imgUrls = new ArrayList<>();
    }
}
